<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="created" content="2018-10-23T06:18:10.521000000">
   <meta name="changed" content="2021-07-18T10:59:00.000000000">
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-Language" content="en">
    <title>
      Clock
    </title>
    <link rel="stylesheet" type="text/css" href="../../style.css">
  </head>
  <body>
    <div class="maindiv">
      <h1>
        <img class="iconlibs" src="../../../../icons/6464/clock.png" alt="#########" width="32" height="32"> 
		<em> Clock</em>
      </h1>
      <table>
        <tbody>
          <tr>
            <td>
              <strong>Library:</strong>
            </td>
            <td>
              <a href="index.html">Wiring</a>
            </td>
          </tr>
          <tr>
            <td>
              <strong>Introduced:</strong>
            </td>
            <td>
              2.0 Beta 13 (in Base library, moved to Wiring in 2.7.0)
            </td>
          </tr>
          <tr>
            <td valign="top">
              <strong>Appearance:</strong>
            </td>
            <td valign="top">
              <img class="appearancelibs" src="../../../../img-libs/clock.png" alt="#########" width="64" height="64">
            </td>
          </tr>
        </tbody>
      </table>
      <h2>
        Behavior
      </h2>
      <p>
        The clock toggles its output value on a regular schedule as long as ticks are enabled via the  option <b class="menu">Auto-tick enabled</b> of <a href="../../guide/menu/simulate.html">Simulate menu</a>. (Ticks are disabled by default.) A "tick" is Logisim's unit of time; the speed at which ticks occur can be selected from the submenu<b class="menu">Tick Frequency</b> of the <b class="menu">Simulate</b>
		menu.
      </p>
	  <p>The clock's cycle can be configured using its <b class="propertie">High Duration</b> and <b class="propertie">Low Duration attributes</b>.</p>
	  <p>In the <a href="../../guide/tutorial/tutor-step.html">step-by-step mode</a> the clocks advance by one tick with each keystroke. 
	  </p>
      <p>
        <b class="note">Note</b> that Logisim's simulation of clocks is quite unrealistic: In real circuits, multiple clocks will drift from one another and will never move in lockstep. But in Logisim, all clocks experience ticks at the same rate.
      </p>
      <h2>
        Pins
      </h2>
      <p>
        A clock has only one pin, an output with a bit width of 1, whose value will represent the current value of the clock. The location of this pin is specified in the <b class="propertie">Facing</b> attribute.<br> The clock's value will toggle on its schedule whenever ticks are enabled, and it will advance by one tick each time it is clicked with the Poke tool.
      </p>
      <h2>
        Attributes
      </h2>
      <p>
        When the component is selected or being added, the arrow keys alter its <b class="propertie">Facing</b> attribute.
      </p>
	  <div class="attliste">
      <dl>
        <dt>
          <b class="propertie">Facing</b>
        </dt>
        <dd>
          The side of the component where its output pin should be.
        </dd>
        <dt>
          <b class="propertie">High Duration</b>
        </dt>
        <dd>
          The length of time within each cycle that the clock's output should be 1.
        </dd>
        <dt>
          <b class="propertie">Low Duration</b>
        </dt>
        <dd>
          The length of time within each cycle that the clock's output should be 0.
        </dd>
		<dt>
          <b class="propertie">Phase Offset</b>
        </dt>
        <dd>
           The phase Offset in tick of the clock. Below are two identical clock, one of which (in gray) has a phase shift of 1 tick.<br>
		  <center>
		  <img src="../../../../img-libs/clockshift.png" alt="#########" >
		  </center>
        </dd>
        <dt>
          <b class="propertie">Label</b>
        </dt>
        <dd>
          The text within the label associated with the clock component.
        </dd>
        <dt>
          <b class="propertie">Label Location</b>
        </dt>
        <dd>
          The location of the label relative to the component.
        </dd>
        <dt>
          <b class="propertie">Label Font</b>
        </dt>
        <dd>
          The font with which to render the label.
        </dd>
      </dl>
	  </div>
      <h2>
        Poke Tool Behavior
      </h2>
      <p>
        By clicking on a clock component, you advance all the clocks by one tick.
      </p>
      <h2>
        Text Tool Behavior
      </h2>
      <p>
        Allows the label associated with the component to be edited.
      </p>
      <p>
        <b>Back to</b> <a href="../index.html">Library Reference</a>
      </p>
    </div>
  </body>
</html>
